#include<iostream>
#include<algorithm>
using namespace std;

inline int* input_arr(int N)
{
    int* res = new int[N];
    for(int i = 0;i<N;++i) scanf("%d",res+i);
    return res;
}

int main(int argc, char const *argv[])
{
    int N1,N2;
    int *num1,*num2;
    scanf("%d",&N1); num1 = input_arr(N1);
    scanf("%d",&N2); num2 = input_arr(N2);

    // do merge
    int N = N1+N2;
    int *marr = new int[N];
    int i=0,j=0,k=0;
    while(i<N1 && j < N2) marr[k++] = num1[i] <= num2[j] ? num1[i++] : num2[j++]; 
    while(i<N1) marr[k++] = num1[i++];
    while(j<N2) marr[k++] = num2[j++];

    // wrong def of median. but live with it then.
    printf("%d",marr[(N-1)/2]);
    
    delete[] num1; delete[] num2;
    delete[] marr;
    return 0;
}
